home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Code / module.cls < prev    next >
Text File  |  1997-06-14  |  2KB  |  66 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "CModule"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = True
  10. Option Explicit
  11.  
  12. Public Enum EErrorModule
  13.     eeBaseModule = 13130    ' CModule
  14. End Enum
  15.  
  16. Private idProcess As Long
  17. Private hModule As Long
  18. Private sExePath As String
  19.  
  20. Sub Create(idProcessA As Long, hModuleA As Long, sExePathA As String)
  21.     idProcess = idProcessA
  22.     hModule = hModuleA
  23.     sExePath = sExePathA
  24. End Sub
  25.  
  26. Property Get Handle() As Long
  27.     Handle = hModule
  28. End Property
  29.  
  30. Property Get ProcessID() As Long
  31.     ProcessID = idProcess
  32. End Property
  33.  
  34. Property Get ExePath() As String
  35.     ExePath = sExePath
  36. End Property
  37.  
  38. Property Get ExeFile() As String
  39.     ExeFile = MUtility.GetFileBaseExt(sExePath)
  40. End Property
  41.  
  42. Property Get ExeName() As String
  43.     ExeName = MUtility.GetFileBase(sExePath)
  44. End Property
  45.  
  46. #If fComponent = 0 Then
  47. Private Sub ErrRaise(e As Long)
  48.     Dim sText As String, sSource As String
  49.     If e > 1000 Then
  50.         sSource = App.ExeName & ".Module"
  51.         Select Case e
  52.         Case eeBaseModule
  53.             BugAssert True
  54.        ' Case ee...
  55.        '     Add additional errors
  56.         End Select
  57.         Err.Raise COMError(e), sSource, sText
  58.     Else
  59.         ' Raise standard Visual Basic error
  60.         sSource = App.ExeName & ".VBError"
  61.         Err.Raise e, sSource
  62.     End If
  63. End Sub
  64. #End If
  65.  
  66.